home *** CD-ROM | disk | FTP | other *** search
- Path: news.missouri.edu!NewsWatcher!user
- From: surgsw@mizzou1.missouri.edu (Joel Weinstein)
- Newsgroups: comp.lang.c
- Subject: Problem with c code, please help!
- Date: Fri, 19 Jan 1996 01:48:53 -0700
- Organization: University of Missouri - Columbia
- Message-ID: <surgsw-1901960148530001@128.206.206.86>
- NNTP-Posting-Host: mizzou-ts10-09.missouri.edu
-
- I have been trying to get this very simple piece of code to work for
- hours. What is the problem???????
-
- #include <stdio.h>
-
- main()
- {
- int i=0;
- char word[100], c;
- printf("Enter a word: ");
- while( (c = getchar()) != '\n') {
- *word = c;
- word == word + 1;
- }
- printf("You entered: ");
- *word = 0;
- while( *word != '\n' )
- {
- putchar( *word );
- word == word + 1;
- }
- }
-
- I think the problem I am having is due to my not knowing when to use the
- '*' operator. When do you use it? Also, why won't my goddam compiler let
- me do word++; instead of word == word +1; I also tried to do *word++;
- and it didn't work, what is the deal with that. It won't let me put word
- = word + 1;. It insists on the double ='s. Why is that?
-
- Please send e-mail.
-
- Joel
-
- ps: is there a way to find out what exactly error messages mean? I kept
- getting something similar to: not an Ivalue. It would be nice if I knew
- what the hell that meant.
-